package com.example.demo.mapper;

import com.example.demo.entity.Browse;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BrowseMapper {

    @Insert("insert into browse(CustomerId,BookName,Price,Date) values(#{CustomerId},#{BookName},#{Price},#{Date})")
    void insert(Browse browse);

    @Select("select * from browse where CustomerId=#{id} order by Date desc")
    List<Browse> selectBrowse(String id);

    @Delete("delete from browse where BrowseId=#{id}")
    void deleteBrowse(String id);

    @Select("select * from browse where CustomerId=#{id} and Date=#{date} order by Date desc")
    List<Browse> selectBrBD(String id, String date);
}
